package edu.cuit.avatar.mapper;

import edu.cuit.avatar.pojo.Score;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/29 11:27
 */
@Mapper
public interface ScoreMapper {

    @Insert("insert into score(ssn, cou_id, sc_date, score) values(#{ssn}, #{couId}, #{scDate}, #{score})")
    void insert(Score score);

    @Delete("delete from score where id=#{id}")
    void deleteById(Integer id);

    @Update("update score set score=#{score} where ssn=#{ssn} and cou_id=#{couId}")
    void update(Score score);

    @Select("select id, ssn, cou_id, sc_date, score from score where ssn = #{ssn}")
    List<Score> findBySsn(String ssn);
}
